package com.rickpan.dto.siliconflow;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * 硅基流动图片生成请求DTO
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SiliconFlowImageRequest {

    private String model = "Kwai-Kolors/Kolors";
    
    private String prompt;
    
    @JsonProperty("image_size")
    private String imageSize;
    
    @JsonProperty("batch_size")
    private Integer batchSize;
    
    @JsonProperty("num_inference_steps")
    private Integer numInferenceSteps;
    
    @JsonProperty("guidance_scale")
    private Double guidanceScale;

    // 可选字段
    @JsonProperty("negative_prompt")
    private String negativePrompt;

    private Long seed;

    // 可选的参考图片（base64格式）
    private String image;

    // 构造函数
    public SiliconFlowImageRequest() {}

    // Builder模式
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private SiliconFlowImageRequest request = new SiliconFlowImageRequest();

        public Builder model(String model) {
            request.model = model;
            return this;
        }

        public Builder prompt(String prompt) {
            request.prompt = prompt;
            return this;
        }

        public Builder imageSize(String imageSize) {
            request.imageSize = imageSize;
            return this;
        }

        public Builder batchSize(Integer batchSize) {
            request.batchSize = batchSize;
            return this;
        }

        public Builder numInferenceSteps(Integer numInferenceSteps) {
            request.numInferenceSteps = numInferenceSteps;
            return this;
        }

        public Builder guidanceScale(Double guidanceScale) {
            request.guidanceScale = guidanceScale;
            return this;
        }

        public Builder negativePrompt(String negativePrompt) {
            request.negativePrompt = negativePrompt;
            return this;
        }

        public Builder seed(Long seed) {
            request.seed = seed;
            return this;
        }

        public Builder image(String image) {
            request.image = image;
            return this;
        }

        public SiliconFlowImageRequest build() {
            return request;
        }
    }

    // Getter 和 Setter 方法
    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getPrompt() {
        return prompt;
    }

    public void setPrompt(String prompt) {
        this.prompt = prompt;
    }

    public String getImageSize() {
        return imageSize;
    }

    public void setImageSize(String imageSize) {
        this.imageSize = imageSize;
    }

    public Integer getBatchSize() {
        return batchSize;
    }

    public void setBatchSize(Integer batchSize) {
        this.batchSize = batchSize;
    }

    public Integer getNumInferenceSteps() {
        return numInferenceSteps;
    }

    public void setNumInferenceSteps(Integer numInferenceSteps) {
        this.numInferenceSteps = numInferenceSteps;
    }

    public Double getGuidanceScale() {
        return guidanceScale;
    }

    public void setGuidanceScale(Double guidanceScale) {
        this.guidanceScale = guidanceScale;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getNegativePrompt() {
        return negativePrompt;
    }

    public void setNegativePrompt(String negativePrompt) {
        this.negativePrompt = negativePrompt;
    }

    public Long getSeed() {
        return seed;
    }

    public void setSeed(Long seed) {
        this.seed = seed;
    }

    @Override
    public String toString() {
        return "SiliconFlowImageRequest{" +
                "model='" + model + '\'' +
                ", prompt='" + prompt + '\'' +
                ", imageSize='" + imageSize + '\'' +
                ", batchSize=" + batchSize +
                ", numInferenceSteps=" + numInferenceSteps +
                ", guidanceScale=" + guidanceScale +
                ", negativePrompt='" + negativePrompt + '\'' +
                ", seed=" + seed +
                ", hasImage=" + (image != null && !image.isEmpty()) +
                '}';
    }
}
